import request from '@/utils/request'
export default {
  getdataitemlistone(facilityGroupId) {
    return request.get(`v3/iot/device/queryLastDataByFacilityGroupNo?facilityGroupNo=${facilityGroupId}&organization=${sessionStorage.organizationNo}`)
  },
  getdataitemlisttwo(facilityId) {
    return request.get(`v3/iot/device/queryLastDataByFacilityNo?facilityNo=${facilityId}&organization=${sessionStorage.organizationNo}`)
  },
  getdatatypelisttwo(datatypeid) {
    return request.post('/dataTypeConfig/queryByCondition', {
      "less": "gl",
      "dataTypeId": datatypeid,
      "organizationNo": sessionStorage.organizationNo
    })
  },
  getdataidechart(param) {
    return request.post('/v3/iot/dataItem/queryByCondition', {
      "visible": true,
      ...param,
      "organizationNo": sessionStorage.organizationNo

    })
  },
  getzhexiandataleft(params) {
    return request.post('v3/iot/dataItem/queryHistory', {
      ...params,
      "organizationNo": sessionStorage.organizationNo
    })
  },
  queryconditionbatch(id) {
    return request.post('v3/batch/productionBatch/queryByCondition', {
      "facilityNo": id,
      "status": 0,
      "organizationNo": sessionStorage.organizationNo
    })
  },
  getphasemethod(batchNo) {
    return request.get(`v3/batch/productionBatch/getPhaseByNo?no=${batchNo}&organizationNo=${sessionStorage.organizationNo}`)
  },
  queryconditionvarity(id) {
    return request.post('/batch/queryByCondition', {
      "plantVarietyId": id,
      "status": false,
      "organizationNo": sessionStorage.organizationNo
    })
  },
  ownFarmingTypelist(params) {
    return request.post('v3/organization/organizationFarmingTypeMapper/queryByCondition', params)
  },
  queryItem() {
    return request.post('/v3/iot/dataTypeConfig/queryByCondition', {
        organizationNo: sessionStorage.organizationNo
    })
}
}
